package de.tum.in.eist.im.client.Chat.ChatChannel;

import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;

import de.tum.in.eist.im.shared.Message.Message;
import de.tum.in.eist.im.shared.User.User;

/**
 * The async counterpart of <code>ChatMessageHandlerServiceAsync</code>.
 */
public interface ChatMessageHandlerServiceAsync {
	
	// send message to the server
	void sendMessage(Message message, AsyncCallback<Boolean> callback);
	
	// get the messages of a channel
	void getMessagesFromDatabase(Long chatChannelId, AsyncCallback<Message[]> callback);
	
	// user methods
	void addUserAsOnline(User user, Long chatChannelId, AsyncCallback<Boolean> callback);
	void addUserAsOnlineToPrivate(User user, Long chatChannelId, AsyncCallback<Boolean> callback);
	void removeUserAsOnline(User user, Long chatChannelId, AsyncCallback<Boolean> callback);
	void getOnlineUsersFromServer(Long chatChannelId, AsyncCallback<List<User>> callback);
}
